<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:util="http://java.sun.com/jsf/composite/components/util"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:p="http://primefaces.prime.com.tr/ui" 
                xmlns:f="http://java.sun.com/jsf/core">

    <div id="messagesList">
        <h:outputText value="Conversation with #{messageControllerBean.otherUser}" />
        
        <h:form id="messagesForm">
            <p:dataTable id="messagesTable" var="message"
                value="#{messageControllerBean.conversation.messages}"
                paginator="true" rows="20" paginatorAlwaysVisible="false">

            <p:column>
                <f:facet name="header">
                    <h:outputText value="#{msg.sender}" />
                </f:facet>
                <h:graphicImage url="#{message.sender.profilePic}"/>
                <h:outputText value="#{message.sender}" />
            </p:column>
            
            <p:column>
                <f:facet name="header">
                    <h:outputText value="#{msg.sent}" />
                </f:facet>
                <h:outputText value="#{message.getDateString()}" />
            </p:column>
	
            <p:column>
                <f:facet name="header">
                    <h:outputText value="#{msg.read}" />
                </f:facet>                
                <h:outputText value="#{message.read}" />
            </p:column>
            
           <p:column>
                <f:facet name="header">
                    <h:outputText value="#{msg.contents}" />
                </f:facet>
               <h:outputText value="#{message.content}" />
           </p:column>
            
        </p:dataTable>
            
        </h:form>
    </div>
</ui:composition>   